<?php

class User extends BaseModel
{

    private $table = 'user';
    private $db;
    public function __construct()
    {
        $this->db = db();
    }

    public function addUser($data)
    {
        $data['pwd'] = password_hash($data['pwd'],PASSWORD_DEFAULT);

        $res =  $this->db->insert($this->table, $data);
        return $res;
    }
    public function getUser($username){
        $res = $this->db->where( ['username'=>$username ] )->select($this->table);
        return $res;
    }

}